const fs = require('fs');

let config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
let server_host = config.verifyServer.host;
let server_port = config.verifyServer.port;
// 优先从环境变量读取
let email_user = process.env.HUAHUA_CHAT_EMAIL_USER || config.email.user;
let email_pass = process.env.HUAHUA_CHAT_EMAIL_PASS || config.email.pass;
let mysql_host = config.mysql.host;
let mysql_port = config.mysql.port;
let redis_host = config.redis.host;
let redis_port = config.redis.port;
let redis_passwd = config.redis.passwd;

module.exports = {email_pass, email_user, mysql_host, mysql_port,redis_host, redis_port, redis_passwd,
    server_host, server_port
}